package com.time.workbench.efficient.util;

import java.io.IOException;
import java.net.InetAddress;
import java.net.UnknownHostException;

public class IpUtil {
    public static boolean isHostReachable(String host, Integer timeOut) {
        try {
            return InetAddress.getByName(host).isReachable(timeOut);
        } catch (UnknownHostException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return false;
    }
}
